﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PositionalIndexer
{
    public class Document : ICloneable
    {
        public int Id { get; set; }
        public String Content { get; set; }

        public bool IsBody
        {
            get
            {
                if (Content.Contains("<body"))
                {
                    if (Content.Contains("</body>"))
                    {
                        return false;
                    }
                    return true;
                }
                return false;
            }
        }

        public Document()
        {
            Id = 0;
            Content = String.Empty;
        }

        public Document(int id, String content)
        {
            Id = id;
            Content = content;
        }

        public void Initialize()
        {
            Id++;
            Content = String.Empty;
        }

        public object Clone()
        {
            return new Document(Id, Content);
        }
    }
}
